package xyz.luhui1hao.sort;

import java.util.Comparator;

/**
 * @ClassName Person
 * @Description TODO
 * @Author luhui1hao
 * @Date 2018/9/25 4:02 PM
 * @Version 1.0
 */
public class Person implements Comparable<Person> {
    private String name;
    private int age;
    private SexEnum sex;
    private int power;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public SexEnum getSex() {
        return sex;
    }

    public void setSex(SexEnum sex) {
        this.sex = sex;
    }

    public int getPower() {
        return power;
    }

    public void setPower(int power) {
        this.power = power;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                '}';
    }

    @Override
    public int compareTo(Person o) {
        return this.getAge() - o.getAge();
    }
}
